import React from 'react';

export default class Child extends React.Component {

  componentDidMount () {
    this.props.sayHello();
  }

  render () {
    return (
      <div>
        { this.props.msg }
        {/* 默认插槽 */}
        { this.props.children }
        <button onClick={ this.props.sayHello }>
          点击执行
          {/* <slot name="suffix" /> */}
          {/* 具名插槽 */}
          { this.props.suffix }
        </button>
      </div>
    );
  }

}
